home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XAAES_S.ZIP / XAAES / K_DEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-02  |  15.0 KB  |  595 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. /*
  9.     Definitions for the standard GEM application data structures
  10.     taken out of the AESBIND.H standard header
  11. */
  12.  
  13. #ifndef _K_DEFS_H_
  14. #define _K_DEFS_H_
  15.  
  16. #ifdef __PUREC__
  17. #define far
  18. #define __regargs
  19. #define __saveds
  20. #define short    int
  21.  
  22. /* Switch off some of PC's warning messages */
  23. #pragma warn -aus    /* 'foo' is assigned a value which is never used */
  24. #pragma warn -rch    /* Unreachable code */
  25. #pragma warn -stv    /* Structure passed by value */
  26. #pragma warn -use    /* 'foo' declared but never used */
  27. #pragma warn -cln    /* Constant is long */
  28. #pragma warn -par    /* Parameter 'foo' is never used */
  29.  
  30. #endif /* __PUREC__ */
  31.  
  32.  
  33. #include "XA_DEFS.H"
  34.  
  35. /* Event library definitions */
  36. #define MU_KEYBD    0x0001
  37. #define MU_BUTTON    0x0002
  38. #define MU_M1        0x0004
  39. #define MU_M2        0x0008
  40. #define MU_MESAG    0x0010
  41. #define MU_TIMER    0x0020
  42.  
  43. #define K_RSHIFT    0x0001
  44. #define K_LSHIFT    0x0002
  45. #define K_CTRL        0x0004
  46. #define K_ALT        0x0008
  47.  
  48. #define MN_SELECTED    10
  49.  
  50. #define SCR_MGR     0x0001    /* process id of the screen manager - this is redundant */
  51.                             /* and will probably require a kludge to redirect it to the */
  52.                             /* 'real' desktop (check the AVSERVER variable?) */
  53. #define AP_MSG           0
  54.  
  55. #define WM_REDRAW    20
  56. #define WM_TOPPED    21
  57. #define WM_CLOSED    22
  58. #define WM_FULLED    23
  59. #define WM_ARROWED    24
  60. #define WM_HSLID    25
  61. #define WM_VSLID    26
  62. #define WM_SIZED    27
  63. #define WM_MOVED    28
  64. #define WM_NEWTOP    29
  65. #define WM_UNTOPPED    30
  66. #define WM_ONTOP    31
  67. #define WM_OFFTOP    32
  68. #define PR_FINISH    33        /* What is PR_FINISH? It has the same number as WM_BOTTOMED... */
  69. #define WM_BOTTOMED    33
  70. #define WM_BOTTOM    33
  71.  
  72. #define WM_ICONIFY            34
  73. #define WM_UNICONIFY        35
  74. #define WM_ALLICONIFY        36
  75.  
  76. #define AC_OPEN        40
  77. #define AC_CLOSE    41
  78.  
  79. #define AP_TERM         50
  80. #define AP_TFAIL        51
  81. #define AP_RESCHG       57
  82. #define SHUT_COMPLETED  60
  83. #define RESCH_COMPLETED 61
  84.  
  85. #define CH_EXIT         80
  86.  
  87. #define CT_UPDATE    50
  88. #define CT_MOVE        51
  89. #define CT_NEWTOP    52
  90. #define CT_KEY        53
  91.  
  92. /* Drag'n'Drop */
  93. #define AP_DRAGDROP            63
  94. #define    DD_OK                0
  95. #define DD_NAK                1
  96. #define DD_EXT                2
  97. #define DD_LEN                3
  98. #define DD_TRASH            4
  99. #define DD_PRINTER            5
  100. #define DD_CLIPBOARD        6
  101. #define DD_TIMEOUT            4000    /* timeout in milliseconds */
  102. #define DD_NUMEXTS            8
  103. #define DD_EXTSIZE            32L
  104. #define DD_NAMEMAX            128        /* max size of a drag&drop item name */
  105. #define DD_HDRMAX            (8+DD_NAMEMAX)    /* max length of a drag&drop header */
  106.  
  107. #define WA_UPPAGE    0
  108. #define WA_DNPAGE    1
  109. #define WA_UPLINE    2
  110. #define WA_DNLINE    3
  111. #define WA_LFPAGE    4
  112. #define WA_RTPAGE    5
  113. #define WA_LFLINE    6
  114. #define WA_RTLINE    7
  115.  
  116. typedef struct moblk
  117. {
  118.     short m_out;
  119.     short m_x;
  120.     short m_y;
  121.     short m_w;
  122.     short m_h;
  123. } MOBLK;
  124.  
  125. /* Object library definitions */
  126. #define ROOT        0
  127. #define NIL            -1
  128.  
  129. #define MAX_DEPTH    8    /* max depth of search or draw */
  130.  
  131. #define IP_HOLLOW    0    /* inside patterns */
  132. #define IP_1PATT    1
  133. #define IP_2PATT    2
  134. #define IP_3PATT    3
  135. #define IP_4PATT    4
  136. #define IP_5PATT    5
  137. #define IP_6PATT    6
  138. #define IP_SOLID    7
  139.                            /* system foreground and */
  140.                            /*   background rules    */
  141. #define SYS_FG      0x1100 /*   but transparent     */
  142.  
  143. #define WTS_FG      0x11a1 /* window title selected */
  144.                            /*   using pattern 2 &   */
  145.                            /*   replace mode text   */
  146. #define WTN_FG      0x1100 /* window title normal   */
  147.  
  148. #define IBM            3    /* font types */
  149. #define SMALL        5
  150.  
  151. #define G_BOX        20    /* Graphic types of obs    */
  152. #define G_TEXT        21
  153. #define G_BOXTEXT    22
  154. #define G_IMAGE        23
  155. #define G_PROGDEF    24
  156. #define    G_USERDEF    G_PROGDEF
  157. #define G_IBOX        25
  158. #define G_BUTTON    26
  159. #define G_BOXCHAR    27
  160. #define G_STRING    28
  161. #define G_FTEXT        29
  162. #define G_FBOXTEXT    30
  163. #define G_ICON        31
  164. #define G_TITLE        32
  165. #define G_CICON         33
  166.  
  167. #define NONE        0x0000    /* Object flags    */
  168. #define SELECTABLE    0x0001
  169. #define DEFAULT        0x0002
  170. #define EXIT        0x0004
  171. #define EDITABLE    0x0008
  172. #define RBUTTON        0x0010
  173. #define LASTOB        0x0020
  174. #define TOUCHEXIT    0x0040
  175. #define HIDETREE    0x0080
  176. #define INDIRECT    0x0100
  177. #define FLD3DIND    0x0200    /* AES3.3 and over extended object flags for 3d widgets */
  178. #define FLD3DBAK    0x0400    /* Atari Compendium mixes up FLD3DACT & FLD3DBAK */
  179. #define FLD3DACT    0x0600
  180. #define FLD3DANY    0x0600
  181. #define SUBMENU        0x0800
  182.  
  183. #define NORMAL        0x0000    /* Object states */
  184. #define SELECTED    0x0001
  185. #define CROSSED        0x0002
  186. #define CHECKED        0x0004
  187. #define DISABLED    0x0008
  188. #define OUTLINED    0x0010
  189. #define SHADOWED    0x0020
  190. #define SPECIAL        0x0040    /* user defined object state */
  191. #define WHITEBAK    0x0040
  192. #define DRAW3D      0x0080
  193.  
  194. #define IS_EDIT     0x8000    /* XaAES special - this object has the text focus */
  195.  
  196. #define WHITE        0    /* Object colors */
  197. #define BLACK        1
  198. #define RED        2
  199. #define GREEN        3
  200. #define BLUE        4
  201. #define CYAN        5
  202. #define YELLOW        6
  203. #define MAGENTA        7
  204. #define LWHITE        8
  205. #define LBLACK        9
  206. #define LRED        10
  207. #define LGREEN        11
  208. #define LBLUE        12
  209. #define LCYAN        13
  210. #define LYELLOW        14
  211. #define LMAGENTA    15
  212.  
  213. #define TE_LEFT        0    /* editable text justification */
  214. #define TE_RIGHT    1
  215. #define TE_CNTR        2
  216.  
  217. typedef struct object
  218. {
  219.     short ob_next;
  220.     short ob_head;
  221.     short ob_tail;
  222.     unsigned short ob_type;
  223.     unsigned short ob_flags;
  224.     unsigned short ob_state;
  225.     void *ob_spec;
  226.     short ob_x;
  227.     short ob_y;
  228.     short ob_width;
  229.     short ob_height;
  230. } OBJECT;
  231.  
  232. typedef struct text_edinfo
  233. {
  234.     char *te_ptext;
  235.     char *te_ptmplt;
  236.     char *te_pvalid;
  237.     short te_font;
  238.     short te_fontid;        /* AES 4.1 extension */
  239.     short te_just;
  240.     short te_color;
  241.     short te_fontsize;        /* AES 4.1 extension */
  242.     short te_thickness;
  243.     short te_txtlen;
  244.     short te_tmplen;
  245. } TEDINFO;
  246.  
  247. /* AES 4.1 extended te_font types */
  248. #define TE_GDOS_PROP    0    /* Use a proportional SPEEDOGDOS font */
  249. #define TE_GDOS_MONO    1    /* Use a monospaced SPEEDOGDOS font */
  250. #define TE_GDOS_BITM    2    /* Use a GDOS bitmap font */
  251. #define TE_STANDARD        3    /* Use the standard system font (10 point) */
  252. #define TE_SMALL        5    /* Use the small syatem font (8 point) */
  253.  
  254. typedef struct icon_block
  255. {
  256.     short *ib_pmask;
  257.     short *ib_pdata;
  258.     char *ib_ptext;
  259.     short ib_char;
  260.     short ib_xchar;
  261.     short ib_ychar;
  262.     short ib_xicon;
  263.     short ib_yicon;
  264.     short ib_wicon;
  265.     short ib_hicon;
  266.     short ib_xtext;
  267.     short ib_ytext;
  268.     short ib_wtext;
  269.     short ib_htext;
  270. } ICONBLK;
  271.  
  272. typedef struct cicon_data
  273. {
  274.     short num_planes;                            /* number of planes in the following data          */
  275.     short *col_data;                            /* pointer to color bitmap in standard form        */
  276.     short *col_mask;                            /* pointer to single plane mask of col_data        */
  277.     short *sel_data;                            /* pointer to color bitmap of selected icon        */
  278.     short *sel_mask;                            /* pointer to single plane mask of selected icon   */
  279.     struct cicon_data *next_res;    /* pointer to next icon for a different resolution */
  280. }    CICON;
  281.  
  282. typedef struct cicon_blk
  283. {
  284.     ICONBLK monoblk;        /* default monochrome icon                         */
  285.     CICON *mainlist;        /* list of color icons for different resolutions */
  286. }    CICONBLK;
  287.  
  288. typedef struct bit_block
  289. {
  290.     short *bi_pdata;
  291.     short bi_wb;
  292.     short bi_hl;
  293.     short bi_x;
  294.     short bi_y;
  295.     short bi_color;
  296. } BITBLK;
  297.  
  298. typedef struct parm_blk
  299. {
  300.     OBJECT *pb_tree;
  301.     short pb_obj;
  302.     short pb_prevstate;
  303.     short pb_currstate;
  304.     short pb_x;
  305.     short pb_y;
  306.     short pb_w;
  307.     short pb_h;
  308.     short pb_xc;
  309.     short pb_yc;
  310.     short pb_wc;
  311.     short pb_hc;
  312.     long pb_parm;
  313. } PARMBLK;
  314.  
  315. typedef struct appl_blk
  316. {
  317.     int (*__stdargs ab_code)(PARMBLK *);
  318.     long ab_parm;
  319. } APPLBLK;
  320.  
  321. typedef struct grect
  322. {
  323.     short g_x;
  324.     short g_y;
  325.     short g_w;
  326.     short g_h;
  327. } GRECT;
  328.  
  329. /* From Atari Compendium - not sure if the bitfield stuff works properly with
  330.    GNU or Pure C, but it's fine with Lattice */
  331. typedef struct objc_colorword
  332. {
  333.     unsigned short borderc:4;
  334.     unsigned short textc:4;
  335.     unsigned short opaque:1;
  336.     unsigned short pattern:3;
  337.     unsigned short fillc:4;
  338. } OBJC_COLORWORD;
  339.  
  340. /* Form library definitions */
  341. #define ED_START    0    /* editable text field definitions */
  342. #define EDSTART    ED_START
  343. #define ED_INIT    1
  344. #define EDINIT    ED_INIT
  345. #define ED_CHAR    2
  346. #define EDCHAR    ED_CHAR
  347. #define ED_END    3
  348. #define EDEND    ED_END
  349.  
  350. #define FMD_START    0
  351. #define FMD_GROW    1
  352. #define FMD_SHRINK    2
  353. #define FMD_FINISH    3
  354.  
  355. /* Graphics library definitions */
  356. #define    ARROW        0
  357. #define    TEXT_CRSR    1
  358. #define    HOURGLASS    2
  359. #define    BUSYBEE    HOURGLASS
  360. #define    BUSY_BEE    HOURGLASS
  361. #define    POINT_HAND    3
  362. #define    FLAT_HAND    4
  363. #define    THIN_CROSS    5
  364. #define    THICK_CROSS    6
  365. #define    OUTLN_CROSS    7
  366. #define    USER_DEF    255
  367. #define M_OFF        256
  368. #define M_ON        257
  369. #define M_PUSH         100
  370. #define M_POP          101
  371.  
  372. #define VERTICAL    0
  373. #define HORIZONTAL    1
  374.  
  375. /* Scrap library definitions */
  376. #define scrp_read(a)    (_AESaddrin[0]=a,_AESif(280))
  377. #define scrp_write(a)    (_AESaddrin[0]=(void *)(a),_AESif(284))
  378. #define SCRAP_CSV   0x0001
  379. #define SCRAP_TXT   0x0002
  380. #define SCRAP_GEM   0x0004
  381. #define SCRAP_IMG   0x0008
  382. #define SCRAP_DCA   0x0010
  383. #define SCRAP_USR   0x8000
  384.  
  385. /* Window library definitions */
  386. #define NAME        0x0001
  387. #define CLOSE        0x0002
  388. #define CLOSER        CLOSE
  389. #define FULL        0x0004
  390. #define FULLER        FULL
  391. #define MOVE        0x0008
  392. #define MOVER        MOVE
  393. #define INFO        0x0010
  394. #define SIZE        0x0020
  395. #define SIZER        SIZE
  396. #define UPARROW        0x0040
  397. #define DNARROW        0x0080
  398. #define VSLIDE        0x0100
  399. #define LFARROW        0x0200
  400. #define RTARROW        0x0400
  401. #define HSLIDE        0x0800
  402. #define SMALLER        0x4000
  403.  
  404. /* Extended XaAES Attributes */
  405. #define STORE_BACK    0x80000000L    /* Store the background of a window & don't generate redraw  */
  406.                                 /* messages to windows below */
  407. #define NO_WORK        0x40000000L    /* A window with no work area */
  408. #define NO_REDRAWS    0x20000000L    /* Don't generate WM_REDRAW messages to the owner app */
  409. #define NO_MESSAGES    0x30000000L    /* Don't generate any messages at all to the owner app */
  410.  
  411.  
  412.  
  413. #define WF_RETURN        1
  414. #define WF_KIND            1
  415. #define WF_NAME         2
  416. #define WF_INFO         3
  417. #define WF_WXYWH        4
  418. #define WF_WORKXYWH        WF_WXYWH
  419. #define WF_CXYWH        5
  420. #define WF_CURRXYWH        WF_CXYWH
  421. #define WF_PXYWH        6
  422. #define WF_PREVXYWH        WF_PXYWH
  423. #define WF_FXYWH        7
  424. #define WF_FULLXYWH        WF_FXYWH
  425. #define WF_HSLIDE        8
  426. #define WF_VSLIDE        9
  427. #define WF_TOP            10
  428. #define WF_FIRSTXYWH    11
  429. #define WF_NEXTXYWH        12
  430. #define WF_IGNORE        13
  431. #define WF_NEWDESK        14
  432. #define WF_HSLSIZE        15
  433. #define WF_HSLSIZ        WF_HSLSIZE
  434. #define WF_VSLSIZE        16
  435. #define    WF_VSLSIZ        WF_VSLSIZE
  436. #define WF_SCREEN        17
  437. #define WF_COLOR        18
  438. #define WF_DCOLOR        19
  439. #define WF_OWNER        20
  440. #define WF_BEVENT       24
  441. #define WF_BOTTOM        25
  442. #define WF_ICONIFY            26
  443. #define WF_UNICONIFY        27
  444. #define WF_UNICONIFYXYWH    28
  445.  
  446. /* XaAES Special modes */
  447. #define WF_AUTOREDRAW        100
  448. #define WF_STOREBACK        101
  449. #define WF_WIDGET            102
  450.  
  451. /* keyboard focus policy */
  452.  
  453. #define FOCUS_MOUSE                1
  454.  
  455. /* XaAES extensions */
  456.  
  457. #define    END_UPDATE    0
  458. #define    BEG_UPDATE    1
  459. #define    END_MCTRL    2
  460. #define    BEG_MCTRL    3
  461. #define BEG_EMERG        4
  462. #define END_EMERG        5
  463.  
  464. #define WC_BORDER    0
  465. #define WC_WORK        1
  466.  
  467. #define DESK    0
  468.  
  469. #define    W_BOX        0
  470. #define W_TITLE        1
  471. #define W_CLOSER    2
  472. #define W_NAME        3
  473. #define W_FULLER    4
  474. #define W_INFO        5
  475. #define W_DATA        6
  476. #define W_WORK        7
  477. #define W_SIZER        8
  478. #define W_VBAR        9
  479. #define W_UPARROW    10
  480. #define W_DNARROW    11
  481. #define W_VSLlDE    12
  482. #define W_VELEV        13
  483. #define W_HBAR        14
  484. #define W_LFARROW    15
  485. #define W_RTARROW    16
  486. #define W_HSLIDE    17
  487. #define W_HELEV        18
  488.  
  489. /* Resource library definitions */
  490. #define R_TREE        0
  491. #define R_OBJECT    1
  492. #define R_TEDINFO    2
  493. #define R_ICONBLK    3
  494. #define R_BITBLK    4
  495. #define R_STRING    5    /* gets pointer to free strings */
  496. #define R_IMAGEDATA    6    /* gets pointer to free images */
  497. #define R_OBSPEC    7
  498. #define R_TEPTEXT    8    /* sub ptrs in TEDINFO */
  499. #define R_TEPTMPLT    9
  500. #define R_TEPVALID    10
  501. #define R_IBPMASK    11    /* sub ptrs in ICONBLK */
  502. #define R_IBPDATA    12
  503. #define R_IBPTEXT    13
  504. #define R_BIPDATA    14    /* sub ptrs in BITBLK */
  505. #define R_FRSTR        15    /* gets addr of ptr to free strings */
  506. #define R_FRIMG        16    /* gets addr of ptr to free images */
  507.  
  508. typedef struct
  509. {
  510.     short rsh_vrsn;            /* RCS version no. */
  511.     unsigned short rsh_object;    /* offset to object[] */
  512.     unsigned short rsh_tedinfo;    /* offset to tedinfo[] */
  513.     unsigned short rsh_iconblk;    /* offset to iconblk[] */
  514.     unsigned short rsh_bitblk;    /* offset to bitblk[] */
  515.     unsigned short rsh_frstr;        /* offset to free string index */
  516.     unsigned short rsh_string;    /* offset to first string */
  517.     unsigned short rsh_imdata;    /* offset to image data */
  518.     unsigned short rsh_frimg;        /* offset to free image index */
  519.     unsigned short rsh_trindex;    /* offset to object tree index */
  520.     short rsh_nobs;            /* number of objects */
  521.     short rsh_ntree;            /* number of trees */
  522.     short rsh_nted;            /* number of tedinfos */
  523.     short rsh_nib;            /* number of icon blocks */
  524.     short rsh_nbb;            /* number of blt blocks */
  525.     short rsh_nstring;        /* number of free strings */
  526.     short rsh_nimages;        /* number of free images */
  527.     unsigned short rsh_rssize;    /* total bytes in resource */
  528. } RSHDR;
  529.  
  530. /* AES parameter block */
  531. typedef struct {
  532.     short *contrl;
  533.     short *globl;
  534.     short *intin;
  535.     short *intout;
  536.     void  **addrin;
  537.     void  **addrout;
  538. } AESPB;
  539.  
  540. /*
  541.     XaAES/oAESis Extended Shell Write structure 
  542.     - extra fields for UID/GID setting of spawned clients.
  543. */
  544. typedef struct _xshelw {
  545.     char *newcmd;
  546.     long psetlimit;
  547.     long prenice;
  548.     char *defdir;
  549.     char *env;
  550.     short uid;            /* New child's UID */
  551.     short gid;            /* New child's GID */
  552. } XSHELW;
  553.  
  554. #define SW_PSETLIMIT    0x100
  555. #define SW_PRENICE        0x200
  556. #define SW_PDEFDIR        0x400
  557. #define SW_ENVIRON        0x800
  558. #define SW_UID             0x1000   /* Set user id of launched child */
  559. #define SW_GID            0x2000   /* Set group id of launched child */
  560.  
  561. /* Menu bar install/remove codes */
  562. #define MENU_REMOVE        0
  563. #define MENU_INSTALL    1
  564. #define MENU_INQUIRE    -1
  565.  
  566. /*------------------------------------------------------------ */
  567. /* SPECIAL XaAES stuff */
  568.  
  569. /* AES Command types */
  570. #define AESCMD_STD        0xc8        /* Standard blocking AES call (process blocks for reply) */
  571. #define AESCMD_TEST        0xc9        /* The 'secret' test for installed AES call */
  572. #define AESCMD_NOREPLY    0xca        /* Process isn't interested in reply so don't give one */
  573. #define AESCMD_NOBLOCK    0xcb        /* Don't block for reply, but place in process reply pipe */
  574.                                     /* -process is handling it's own reply pipe */
  575. #define VDICMD_STD        79            /* The trap was a VDI trap, so call the old vector instead */
  576.  
  577. /* Mouse Handler Fake Process */
  578. #define XAPID_MOUSE        0            /* As MiNT is always pid 0 and won't send XaAES any */
  579.                                     /* commands, I use id 0 to fake up a mouse server process */
  580.  
  581. /* Extra mouse forms */
  582. #define XACRS_BUBBLE_DISC    258        /* The Data Uncertain logo */
  583. #define XACRS_RESIZER        259        /* The 'resize window' cursor */
  584. #define XACRS_MOVER            260        /* The 'move window' cursor */
  585.  
  586. #define    CGd        0x01    /* numeric digit */
  587. #define CGa        0x02    /* alpha */
  588. #define    CGs        0x04    /* whitespace */
  589. #define    CGu        0x08    /* upper case */
  590. #define CGp     0x10    /* punctuation character */
  591. #define    CGdt    0x20    /* dot */
  592. #define    CGw        0x40    /* wild card */
  593. #define CGxp    0x80    /* extended punctuation */
  594.  
  595. #endif